<template>
	<view class="page" :style="{'min-height':h+'px'}">
		<c-nav-bar :title="titleHeader" ></c-nav-bar>
		<view class="title">开票详情</view>
		<view class="item">
			<text>开票状态</text>
			<text>{{item.status==1?'开票中':'已完成'}}</text>
		</view>
		<view class="item i_bt">
			<text>开票方</text>
			<text>{{item.company}}</text>
		</view>
		<view class="item i_bt">
			<text>发票抬头</text>
			<text>{{item.name}}</text>
		</view>
		<view class="item i_mt20">
			<text>发票抬头</text>
			<text>￥{{item.price}}</text>
		</view>
		<view class="item i_bt">
			<text>发票订单</text>
			<view class="i_order" @tap="detailsShow=true">
				含{{item.orderList.length}}个订单
				<image src="@/static/index/steamerTicket/icon_yjt.png"></image>
			</view>
		</view>
		<view class="item i_bt">
			<text>申请时间</text>
			<text>{{item.applyTime}}</text>
		</view>
		<view class="title" v-if="item.email">接收方式</view>
		<view class="item" v-if="item.email">
			<text>电子邮件</text>
			<text>{{item.email}}</text>
		</view>
		<u-popup :show="detailsShow" @close="detailsShow=false" mode="center">
			<view class="details">
				<view class="title">
					<text>开票订单详情</text>
					<image src="@/static/index/steamerTicket/icon_close.png" @tap="detailsShow=false"></image>
				</view>
				<view class="d_item" v-for="(order,index) in item.orderList" :key="index">
					<view>
						<view class="di_left">
							<image src="https://i.ringzle.com/file/20231108/54bc2c75dfde4b83b2089faf1061624d.png"></image>
							<text>{{order.datetime}}</text>
						</view>
						<view class="di_right">￥{{order.price.toFixed(2)}}</view>
					</view>
					<view>
						<view class="di_left">
							<image src="https://i.ringzle.com/file/20231106/e3d8756b026849a69a24980df25bf3af.png"></image>
							<text>{{order.from}}-{{order.park}}</text>
						</view>
					</view>
					<view>
						<view class="di_left">
							<image src="https://i.ringzle.com/file/20231109/0fc12fadbe1a48459cc846ee4896ff7a.png"></image>
							<text>{{order.licence}}</text>
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titleHeader:'发票详情',
				h: uni.getSystemInfoSync().windowHeight,
				item:{
					status:1,
					company:'浙江省嵊泗海岛智慧旅游集团',
					name:'文忠成',
					price:105.50,
					orderList:[
						{
							datetime:'2023-09-15 18:30:26',
							price:52.00,
							from:'沈家湾',
							park:'P2停车场',
							licence:'皖A88888'
						},
						{
							datetime:'2023-09-14 19:55:42',
							price:53.50,
							from:'沈家湾',
							park:'P8停车场',
							licence:'皖A88888'
						}
					],
					applyTime:'2023-09-15 18:30:26',
					email:'342595536@qq.com'
				},
				detailsShow:false
			}
		},
		methods: {
			
		}
	}
</script>

<style scoped lang="less">
	.page{
		background: #F5F8FA;
		padding: 15rpx 0;
		box-sizing: border-box;
		padding-top: 130rpx;
		
		&>.title{
			width: 100%;
			padding: 30rpx 0 20rpx 24rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;
			box-sizing: border-box;
		}
		
		.item{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx 24rpx;
			background: #fff;
			box-sizing: border-box;
			&.i_bt{
				border-top: 1rpx solid rgba(112, 112, 112, .1);
			}
			&.i_mt20{
				margin-top: 20rpx;
			}
			text{
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				&:last-child{
					color: #AAAAAA;
				}
			}
			.i_order{
				display: flex;
				align-items: center;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #007A69;
				image{
					width: 30rpx;
					height: 30rpx;
					margin-left: 10rpx;
				}
			}
		}
		
		.details {
			padding: 40rpx 35rpx 50rpx 47rpx;
			&>.title{
				position: relative;
				text-align: center;
				text {
					font-size: 36rpx;
					font-family: PingFang-SC-Bold, PingFang-SC;
					font-weight: bold;
					color: #333333;
				}
			
				image {
					width: 36rpx;
					height: 36rpx;
					position: absolute;
					right: 10rpx;
					top: 50%;
					margin-top: -18rpx;
				}
			}
			.d_item{
				margin-top: 35rpx;
				&>view{
					margin-top: 21rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					.di_left{
						display: flex;
						align-items: center;
						image{
							width: 22rpx;
							height: 22rpx;
						}
						text{
							font-size: 28rpx;
							font-family: PingFang SC;
							font-weight: 400;
							color: #333333;
							margin-left: 8rpx;
						}
					}
					.di_right{
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FE401A;
					}
				}
			}
		}
		
		/deep/.u-popup__content{
			width: calc(100% - 90rpx);
			border-radius: 16rpx;
		}
	}
</style>